function adapterServiceItemData(data) {
  const list = []
  data.inputs?.forEach(item => {
    const paramItem = {
      paramName: item.name,
      category: item.category,
      paramKey: item.identifier,
      showParamOpen: false,
      openParam: {
        isOpen: false,
        dataType: item.category,
        description: '',
        enumValue: [],
        maxValue: undefined,
        value: undefined
      },
      value: null
    }
    list.push(paramItem)
  })
  return list
}

function generatorTreeSelectData(treeData, findItem) {
  const res = []
  treeData.forEach(item => {
    const selectedNode = item.children.find(child => `${child.value}` === `${findItem}`)
    if (selectedNode) {
      res.push(item.value, selectedNode.value)
    }
  })
  return res
}
export {
  generatorTreeSelectData,
  adapterServiceItemData
}
